# coding=utf-8

from src.newselenium import Driver, By, Keys, Element
from selenium.webdriver.common.action_chains import ActionChains
from elements.element_jira import Element_Jira
from src.public.public import Public
from src.config.config import Config
import time, os, traceback
import collections
from selenium import webdriver
import configparser
import chardet
import codecs

browser = Driver("https://www.baidu.com")
print(type(browser.driver))
# browser.implicitly_wait(20)

# browser = webdriver.Firefox(executable_path=r"C:\Users\zhangzheng17239\Desktop\Python\Selenium\Project_Selenium\drivers\geckodriver.exe")
# browser.get("https://www.baidu.com/")
# # browser.implicitly_wait(10)
# browser.quit()


# # config = configparser.ConfigParser()
# config_path = r"C:\Users\zhangzheng17239\Desktop\Python\Selenium\Project_Selenium\config\config.ini"
# with open(config_path, "rb") as file:
#     s = file.read()
#     # print(s)
#     # print(chardet.detect(s))
#     # s = s[len(codecs.BOM_UTF8):]
#     # print(s)
#     # print(chardet.detect(s))
# if s.startswith(codecs.BOM_UTF8):
#     print("bom")
#     s = s[len(codecs.BOM_UTF8):]
#     # new_s = s.decode(encoding="utf-8")
#     with open(file=config_path, mode="wb") as f:
#         f.write(s)
# #     result = chardet.detect(file.read())
# # print(result)
# # config.read(filenames=config_path, encoding="utf_8")
